Problem in Dashboard in Basic Flask Website

by: kevin951107, 8 years ago


The IP/dashboard/  website only can show exactly what the header.html page shows. It cannot show the body element in the dashboard.html. Please teach me how to resolve this problem. Thank you very much.

{% extends "header.html" %}

{% block body %}

<div role="tabpanel">

  <!-- Nav tabs -->
  <ul class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#basics" aria-controls="basics" role="tab" data-toggle="tab">Basics</a></li>
    <li role="presentation"><a href="#wdev" aria-controls="wdev" role="tab" data-toggle="tab">Web Dev</a></li>
    <li role="presentation"><a href="#dan" aria-controls="dan" role="tab" data-toggle="tab">Data Analysis</a></li>

  </ul>

  <!-- Tab panes -->
<div class="tab-content">
  <div role="tabpanel" class="tab-pane fade in active" id="basics">
<ul>
   <li>dfadsfasf</li>
   <li>jjh</li>
   <li>assggg</li>
</ul>
  </div>
  
  <div role="tabpanel" class="tab-pane fade" id="wdev">web dev</div>

  <div role="tabpanel" class="tab-pane fade" id="dan">Data analysis!#Q$@!#</div>

</div>

</div>

{% endblock %}


My IP address is http://159.203.126.233/ .
.py is exactly  right format.









You must be logged in to post. Please login or register an account.



First off, your first tab panel appears to be encasing all other tab panels and content.  Double check your encasings are correct and make sure your divs are enclosing the right areas.  Your header file should contain things you want universal, ie nav bar and footer, as well as the required html tag, meta, head , js, etc.

So, between your nav bar or 'header' tag, and your 'footer'  you should have your template code block that is going to be the placeholder for the dashboard page:  

'header'

{% block body %}
{% endblock %}

'footer'

Then the block body and endblock on your dashboard page content should insert right in that template code block.   Also you can only use block body once per page, if you have more it wont work, so will have to use different names ie block content etc. Pretty simple once you get the hang of it.  hope that helps

-kingfitz 8 years ago

You must be logged in to post. Please login or register an account.